<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>信息管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
        function selectAll(){  
		    if ($("#SelectAll").attr("checked")) {  
		        $(":checkbox").attr("checked", true);  
		    } else {  
		        $(":checkbox").attr("checked", false);  
		    }  
		}  
		
		//子复选框的事件  
		function setSelectAll(){  
		    //当没有选中某个子复选框时，SelectAll取消选中  
		    if (!$("#subcheck").checked) {  
		        $("#SelectAll").attr("checked", false);  
		    }  
		    var chsub = $("input[type='checkbox'][id='subcheck']").length; //获取subcheck的个数  
		    var checkedsub = $("input[type='checkbox'][id='subcheck']:checked").length; //获取选中的subcheck的个数  
		    
		    if (checkedsub == chsub) {  
		        $("#SelectAll").attr("checked", true);  
		    } 
	    }
        function merge2(){
        	var chk_value =[];    
			$("input[type='checkbox'][id='subcheck']:checked").each(function(){    
			 chk_value.push($(this).val());    
			});    
			if (chk_value.length >1){
				$.get("${ctx}/cms/taskOperation/megre?ids=" + JSON.stringify(chk_value));
			}
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/cms/taskGroup/">信息列表</a></li>
<!-- 		<shiro:hasPermission name="cms:taskGroup:edit"><li><a href="${ctx}/cms/taskGroup/form">信息添加</a></li></shiro:hasPermission> -->
	</ul>
	<form:form id="searchForm" modelAttribute="taskGroup" action="${ctx}/cms/taskGroup/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>合并条码id：</label>
				<form:input path="id" htmlEscape="false" maxlength="11" class="input-medium"/>
			</li>
			<li><label>用户id：</label>
				<form:input path="userid" htmlEscape="false" maxlength="11" class="input-medium"/>
			</li>
			<li><label>工序：</label>
				<form:input path="opdesc" htmlEscape="false" maxlength="100" class="input-medium"/>
			</li>
			<li><label style="display: inline;">任务合并描述：</label>
				<form:input path="alltaskdesc" htmlEscape="false" maxlength="1000" class="input-medium"/>
			</li>
			<li><label>是否开始：</label>
				<form:input path="isstart" htmlEscape="false" maxlength="4" class="input-medium"/>
			</li>
			<li><label>是否完工：</label>
				<form:input path="istaskcomplete" htmlEscape="false" maxlength="4" class="input-medium"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
<!-- 			<li><a class="btn btn-primary" href="javascript:merge();" onclick="return confirmx('确认要合并选中数据吗？', this.href)">打印</a></li> -->
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<!-- <th>
				<p><input type="checkbox" id="SelectAll"
					onclick="selectAll()" /></p>
				</th> -->
				<th>合并条码id</th>
				<th>用户id</th>
				<th>工序</th>
				<th>部门</th>
				<th>任务合并描述</th>
				<th>记录数</th>
				<th>是否开始</th>
				<th>是否完工</th>
				<th>计划日期</th>
				<%-- <shiro:hasPermission name="cms:taskGroup:edit"><th>操作</th></shiro:hasPermission> --%>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="taskGroup">
			<tr>
<!-- 				<td><input type="checkbox" id="subcheck" -->
<!-- 						value="${taskGroup.id}" onclick="setSelectAll()"></input> -->
<!-- 					</td> -->
				<td><%-- <a href="${ctx}/cms/taskGroup/form?id=${taskGroup.id}"></a> --%>
					${taskGroup.id}
				</td>
				<td>
					${taskGroup.userid}
				</td>
				<td>
					${taskGroup.opdesc}
				</td>
				<td>
					${taskGroup.jcdeptid}
				</td>
				<td>
					${taskGroup.alltaskdesc}
				</td>
				<td>
					${taskGroup.allcount}
				</td>
				<td>
					${taskGroup.isstart}
				</td>
				<td>
					${taskGroup.istaskcomplete}
				</td>
				<td>
					<fmt:formatDate value="${taskGroup.pdate}" pattern="yyyy-MM-dd"/>
				</td>
<!-- 				<shiro:hasPermission name="cms:taskGroup:edit"><td> -->
<!--     				<a href="${ctx}/cms/taskGroup/form?id=${taskGroup.id}">修改</a> -->
<!-- 					<a href="${ctx}/cms/taskGroup/delete?id=${taskGroup.id}" onclick="return confirmx('确认要删除该信息吗？', this.href)">删除</a> -->
<!-- 				</td></shiro:hasPermission> -->
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>